package com.ag.oa.core.controller;

import com.ag.oa.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/redis")
public class RedisController {

    @Autowired
    private RedisUtils redisUtils;

    /**
     * 获取世界频道，最后100条数据
     * @return
     */
    @GetMapping("/getWorldChannelLast100Msg")
    public List<Object> getWorldChannelLast100Msg(){

        return redisUtils.lGet("world_channel",-100,-1);
    }

}
